package com.cnhis.cloudhealth.clinical.osworks.commonsql.bo;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.cnhis.cloudhealth.clinical.osworks.commonsql.dao.OsHooperDao;
import com.cnhis.cloudhealth.clinical.osworks.commonsql.dao.OsSchemeDao;
import com.cnhis.cloudhealth.commons.Mappers.ModelVo;
import com.cnhis.cloudhealth.commons.utils.GlobalVariable;
import com.cnhis.cloudhealth.commons.utils.Page;
import com.cnhis.cloudhealth.commons.utils.StaticKeys;
import com.cnhis.cloudhealth.commons.utils.Xml2JsonUtil;
import com.cnhis.cloudhealth.commons.vo.exception.BaseException;

@Service
public class OsSchemeBo {
	
	@Resource
	private OsSchemeDao osSchemeDao;

	@SuppressWarnings("rawtypes")
	public List get669() {
		List list = null;
		try{
			 list = osSchemeDao.get669();
		}catch(Exception e){
			e.printStackTrace();
			throw BaseException.getDetailMessage(e);
		}
		return list;
	}

	@SuppressWarnings("rawtypes")
	public List get702(Map<String, Object> map) {
		List list = null;
		try{
			 list = osSchemeDao.get702(map);
		}catch(Exception e){
			e.printStackTrace();
			throw BaseException.getDetailMessage(e);
		}
		return list;
	}
	@SuppressWarnings("rawtypes")
	public List get701(Map<String, Object> map) {
		List list = null;
		try{
			 list = osSchemeDao.get701(map);
		}catch(Exception e){
			e.printStackTrace();
			throw BaseException.getDetailMessage(e);
		}
		return list;
	}
	@SuppressWarnings("rawtypes")
	public List get707(Map<String, Object> map) {
		List list = null;
		try{
			 list = osSchemeDao.get707(map);
		}catch(Exception e){
			e.printStackTrace();
			throw BaseException.getDetailMessage(e);
		}
		return list;
	}
	@SuppressWarnings("rawtypes")
	public List get703(Map<String, Object> map) {
		List list = null;
		try{
			 list = osSchemeDao.get703(map);
		}catch(Exception e){
			e.printStackTrace();
			throw BaseException.getDetailMessage(e);
		}
		return list;
	}

	@SuppressWarnings("rawtypes")
	public ModelVo insertCAU1(Map<String, Object> map) {
		ModelVo mv = new ModelVo();
		try{
			int CAU01 = osSchemeDao.getCAU01();
			map.put("CAU01", CAU01);
			List CAU01List = osSchemeDao.getCAU01List(map);
			if(CAU01List.size() > 0){
				mv.setResult(StaticKeys.OH_FALSE);
				mv.setResultMsg("新增手术方案ID已经存在请重新保存！");
				return mv;
			}
			int i = osSchemeDao.insertCAU1(map);
			if(i <= 0){
				mv.setResult(StaticKeys.OH_FALSE);
				mv.setResultMsg("新增手术方案错误！");
				return mv;
			}
		}catch(Exception e){
			e.printStackTrace();
			throw BaseException.getDetailMessage(e);
		}
		mv.setResult(StaticKeys.OH_SUCCESS);
		return mv;
	}
}
